Dynamic fowarding with SOCKS5 proxy [on hold]

Posted by bh3244 on Server Fault See other posts from Server Fault or by bh3244
Published on 2014-06-05T21:55:52Z Indexed on 2014/06/06 3:27 UTC
Read the original article Hit count: 377

Filed under:
|
|
|

I'm building my own SOCKS5 client and HTTP library and am having trouble figuring out how things work with dynamic port forwarding. So far I can connect successfully with my SOCKS5 client, but from there on I am stuck. I am using the

ssh -D

command. Considering I have my local machine "home" and my server "server" and I wanted to use "server" as proxy for all connections I understand I would type

ssh -D "localport" "serverhostname"

on my local machine "home".

This command I understand has ssh accept connections with the SOCKS5 protocol. So now if I want to connect to google.com(74.125.224.72:80) and issue a GET for the front page, I assume I would send the SOCKS5 client request and the server would respond back with a 0x00 "succeeded" and from then on I am connected and I would send the HTTP GET request and the server would respond back accordingly with the data. Now if I want to navigate to a different website, must I issue another SOCKS5 connection request for that sites IP/hostname?

I'm confused if this is the way it is done, or if there is a program listening on the local port of the "server" and handling outgoing and incoming data.

To reiterate:

Do SOCKS5 proxies work by sending repeated SOCKS5 connection requests for different addresses or is there just one connection to a local port on "server" and another program on "server" handles the outgoing connection to the internet by using that local port to send and receive data to/from "home"?

© Server Fault or respective owner

Related posts about ssh

Related posts about port-forwarding